package day019.ioStream;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileInputStreamDemo7 {
    public static void main(String[] args) {
        try (
                FileInputStream fis = new FileInputStream("D:\\ideaProjects\\javase_code\\study-practice\\" +
                        "src\\day019\\ioStream\\day019_demo\\dog.jpg");
                FileOutputStream fos = new FileOutputStream("D:\\ideaProjects\\javase_code\\study-practice\\" +
                        "src\\day019\\ioStream\\day019_demo\\test4.jpg");
        ) {
            byte[] bys = new byte[1024];
            int len;
            while ((len = fis.read(bys)) != -1) {
                fos.write(bys, 0, len);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
